import configObj from '@/config'
import storage from '@/utils/storage'
import constant from '@/utils/constant'
import { UserState, UserForm } from '@/types/store'
import { Module } from 'vuex'

const config: Module<UserState, UserState> = {
  state: {
	appId: configObj.APPID,
	apkId: storage.get(constant.apkId)
  },
  mutations: {
    SET_APKID: (state, apkId: string) => {
      state.apkId = apkId
	  storage.set(constant.apkId, apkId)
    }
  },

  actions: {
    // 登录
    setApkId({ commit }, apkId: String) {
      commit('SET_APKID', apkId)
    }
  
  
  }
}

export default config
